<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String path = request.getContextPath();
    String basePath =
            request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
<head>
    <base href="<%=basePath%>">
    <meta charset="UTF-8">
    <title>Insert title here</title>
    <link href="static/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            margin: 0;
        }

        .abox {
            position: relative;
            width: 900px;
            height: 900px;
        }

        .box {
            position: absolute;
            width: 800px;
            height: 800px;
            top: 1%;
            left: 5%;
        }
    </style>
</head>
<body>
<div class="abox">
    <div class="box">
        <h3>用户列表</h3>
        <a href="<c:url value="user/input"/>">继续添加</a>
        <table class="table table-bordered table-hover">
            <tbody class="text-center">
            <tr>
                <th>用户名</th>
                <th>兴趣爱好</th>
                <th>朋友</th>
                <th>职业</th>
                <th>户籍</th>
                <th>个人描述</th>
            </tr>
            <c:forEach items="${users}" var="user">
                <tr>
                    <td>${user.userName }</td>
                    <td>
                        <c:forEach items="${user.hobby }" var="hobby">
                            ${hobby }&nbsp;
                        </c:forEach>
                    </td>
                    <td>
                        <c:forEach items="${user.friends }" var="friend">
                            ${friend }&nbsp;
                        </c:forEach>
                    </td>
                    <td>${user.carrer }</td>
                    <td>${user.houseRegister }</td>
                    <td>${user.remark }</td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
</div>
</body>
</html>